package com.neu.cloudFactory.VO;

import com.neu.cloudFactory.PO.Bid;
import com.neu.cloudFactory.PO.Factory;
import com.neu.cloudFactory.PO.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class BidInfoVO {
    private String id;
    private String orderId;
    private String factory;
    private String manager;
    private String phone;
    private String price;
    private String isChosen;

    public BidInfoVO(Bid bid, User user,Factory factory){
        this.id = Integer.toString(bid.getId());
        this.orderId = Integer.toString(bid.getOrderId());
        this.factory = factory.getName();
        this.manager = user.getName();
        this.phone = user.getPhone();
        this.price = bid.getBidPrice();
        this.isChosen = bid.getBidState();
    }
}
